/**
 * 热门分类管理api
 * @author: liling
 * @date: 2021-01-12
 */
import request from '@/utils/request';

// 获取表格信息
export function getTableInfo(query) {
  return request({
    url: process.env.VUE_APP_KSTB_ROUTE_PATH + '/yxpz/kstbHotClassify/pageList',
    method: 'post',
    params: query
  })
}

// 获取热门分类树
export function queryTree(parentOid) {
  return request({
    url: process.env.VUE_APP_KSTB_ROUTE_PATH + '/yxpz/kstbHotClassify/queryDbKstbHotClassifyTree?parentOid=' + (
      parentOid ? parentOid : ''),
    method: 'post',
  })
}

//新增or修改
export function saveOrUpdate(data) {
  return request({
    url: process.env.VUE_APP_KSTB_ROUTE_PATH + '/yxpz/kstbHotClassify/saveOrUpdate',
    method: 'post',
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data: data
  })
}

// 删除
export function deleteItem(id) {
  return request({
    url: process.env.VUE_APP_KSTB_ROUTE_PATH + '/yxpz/kstbHotClassify/delete/' + id,
    method: 'delete',
  })
}
// 批量删除
export function deleteItems(ids) {
  return request({
    url: process.env.VUE_APP_KSTB_ROUTE_PATH + '/yxpz/kstbHotClassify/batchDel/' + ids,
    method: 'delete',
  })
}

// 获取一条详情
export function getOne(id) {
  return request({
    url: process.env.VUE_APP_KSTB_ROUTE_PATH + '/yxpz/kstbHotClassify/getOne/' + id,
    method: 'get',
  })
}
